﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Util
{
    public class TimeFrame
    {
        public static TimeFrame NULL = new TimeFrame(0);
        public static TimeFrame INFINITE = new TimeFrame(long.MaxValue);

        private long start;
        private long end;

        public TimeFrame(long duration) 
            :this(0, duration)
        {
            
        }

        public TimeFrame(long start, long end) 
        {
            this.start = start;
            this.end = end;
        }

        public long getStart() 
        {
            return start;
        }

        public long getEnd() 
        {
            return end;
        }

        public long length()
        {
            return end - start;
        }

        override public String ToString() 
        {
            return String.Format("{0:d}:{1:d}", start, end);
        }
    }
}
